work done by a gas